<template>
	<view>
		<!-- <view style="padding: 10upx;">
			<image src="/static/images/cart/aizixun.png" style="width: 364upx;height: 196upx;" mode="scaleToFill"></image>
			<image src="/static/images/cart/yuyue.png" style="width: 364upx;height: 196upx;" mode="scaleToFill"></image>
		</view> -->
		<view style="padding:40upx 30upx;">
			<view style="font-size: 40upx;font-family: PingFang SC, PingFang SC-Bold;font-weight: 700;color: #000000;">咨询师列表</view>
			<view style="display: flex;margin-top: 30upx;padding-bottom: 40upx;border-bottom: 2upx solid #ddd;" v-for="(item, index) in cartList" :key="index">
				<image :src="item.img" style="width: 120upx;height: 120upx;border-radius: 50%;" mode="scaleToFill"></image>
				<view style="margin-left: 30upx;">
					<view>
						<span style="font-size: 36upx;font-family: PingFang SC, PingFang SC-Bold;color: #333333;">{{item.name}}</span>
						<span style="margin-left: 20upx;width: 177px;font-size: 30upx;font-family: PingFang SC, PingFang SC-Medium;color: #333333;">{{item.lid | formatText}}</span>
					</view>
					<view style="margin-top: 28upx;">
						<span style="font-size: 20upx;font-family: PingFang SC, PingFang SC-Medium;font-weight: 500;color: #a9a9a9;">{{item.gjz | formatText2}}</span>
						<!-- <span style="margin-left: 30upx;font-size: 20upx;font-family: PingFang SC, PingFang SC-Medium;font-weight: 500;color: #a9a9a9;">焦虑</span> -->
					</view>
					<view style="margin-top: 28upx;width: 500upx;">
						<rich-text :nodes="item.jieshao"></rich-text>
						<!-- <span style="overflow: hidden;text-overflow: ellipsis;line-clamp: 2;
height: 66upx;font-size: 24upx;font-family: PingFang SC, PingFang SC-Medium;font-weight: 500;color: #666666;">{{item.jieshao}}</span> -->
					</view>
					<view style="margin-top: 28upx;">
						<span style="border: 2upx solid #4399FC;border-radius: 40upx;padding: 10upx 20upx;color: #0097ff;font-family: PingFang SC, PingFang SC-Medium;font-size: 24upx;" @click="goCart(item.id)">立即咨询</span>
						<!-- <span style="margin-left: 30upx;border: 2upx solid #4399FC;border-radius: 40upx;padding: 10upx 20upx;color: #0097ff;;font-family: PingFang SC, PingFang SC-Medium;font-size: 24upx;" @click="goCart()">立即咨询</span> -->
					</view>
				</view>
			</view>
		</view>
	</view>

</template>
<script>
	import {
		mapState
	} from 'vuex';
	export default {
		data() {
			return {
				empty: false, //空白页现实  true|false
				cartList: []
			};
		},
		onLoad(){
			this.getConlist();
		},
		watch:{
			//显示空白页
			
		},
		computed:{
			...mapState(['hasLogin'])
		},
		methods: {
			//请求数据
			async getConlist(){
				var that = this;
				that.$zdapi.getConlist({
					cid: 7352
				}).then( res => {
					that.cartList = res.data
				})
			},
			navToLogin(){
				uni.navigateTo({
					url: '/pages/public/login'
				})
			},
			
			goCart(id){
				uni.navigateTo({
					url: '/pages/cart/cartDetail?id=' + id
				})
			}
		}
	}
</script>

<style lang='scss'>
 *{
	 box-sizing: border-box;
	 margin: 0;
	 padding: 0;
 }
</style>
